home *** CD-ROM | disk | FTP | other *** search
- # SnapShot
-
- If "{1}" == "--verbose"
- Set VERBOSE "yup"
- Shift
- End
-
- If "`Exists -d "{1}"`" != ""
- Set VICTIM `resolvealias "{1}"`
- Set PARENT "{VICTIM}:"
- Else If `Exists -f "{1}"` != ""
- Echo "SnapShot: Intended victim '{1}' is a file, which is not supported."
- Echo "Why don't you put it in a folder with a Read Me like any normal person?"
- Exit 1
- Else
- Echo "SnapShot: Intended victim '{1}' does not exist (darn)."
- Exit 1
- End
-
- OutToLunch --express
- Set FTP "jjuran:ftp:"
- Set DATE `Echo ā`Date -d -sā` | sed "s/[-.]//g"`
- Set PLAIN "`BaseName "{VICTIM}"`"
- Set SMASHED `Smash "{PLAIN}"`
- Set CHOPPED `Echo {SMASHED} | sed "s/-[0-9][.0-9dab]*//g"`
- Set OLDNAME "{PLAIN}.sit"
- Set NEWNAME "{DATE}-{CHOPPED}.sit"
- Set PACKAGE "{NEWNAME}.bin"
-
- If {VERBOSE}
- #Echo "Cleaning folder '{PLAIN}'."
- Clean --distclean
- End
- If {VERBOSE}
- Echo "Archiving folder '{PLAIN}'."
- Echo "> {OLDNAME}"
- End
- Delete -i "{PARENT}{PLAIN}.sit"
- Stuff "{VICTIM}"
-
- If {VERBOSE}
- Echo "Renaming archive '{OLDNAME}'."
- Echo "> {NEWNAME}"
- End
- Rename "{PARENT}{OLDNAME}" "{PARENT}{NEWNAME}"
-
- If {VERBOSE}
- Echo "Encoding archive '{NEWNAME}'."
- Echo "> {NEWNAME}.bin"
- End
- MacBin "{PARENT}{NEWNAME}"
-
- If Not "`Exists -d "{PARENT}Snapshots:"`"
- If {VERBOSE}
- Echo "Creating the Snapshots directory."
- Echo "> Snapshots"
- End
- NewFolder "{PARENT}Snapshots:"
- End
-
- If {VERBOSE}
- Echo "Saving copy of archive for posterity."
- End
- Move "{PARENT}{NEWNAME}" "{PARENT}Snapshots:"
-
- If {VERBOSE}
- Echo "Copying encoded archive to FTP source tree for eventual upload."
- End
- Duplicate "{PARENT}{PACKAGE}" "{FTP}src:"
-
- # Deleting original copy.
- Delete "{PARENT}{PACKAGE}"
-
- Exit
- # The end.
-